home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 April / PCWorld_2007-04_cd.bin / audio-video / kmplayer / kmp.exe / Shader / DisplayLessThan16 v1_1.txt < prev    next >
Text File  |  2006-09-10  |  709b  |  30 lines

  1. // DisplayLessThan16 v1.1=ps_2_0
  2. // http://www.homecinema-fr.com/forum/viewtopic.php?t=29814317 
  3.  
  4. sampler s0 : register(s0); 
  5. float4 p0 : register(c0); 
  6. float4 p1 : register(c1); 
  7.  
  8. #define width (p0[0]) 
  9. #define height (p0[1]) 
  10. #define counter (p0[2]) 
  11. #define clock (p0[3]) 
  12. #define one_over_width (p1[0]) 
  13. #define one_over_height (p1[1]) 
  14.  
  15. #define PI acos(-1) 
  16. #define Value_16 (16.0/255.0) 
  17.  
  18. float4 main(float2 tex : TEXCOORD0) : COLOR 
  19.    float4 c0 = tex2D(s0, tex); 
  20.  
  21.    if( c0[0]<Value_16 ) 
  22.       c0 = float4( 0, 1, 0, 0 ); 
  23.    else if( c0[1]<Value_16 ) 
  24.       c0 = float4( 0, 1, 0, 0 ); 
  25.    else if( c0[2]<Value_16 ) 
  26.       c0 = float4( 0, 1, 0, 0 ); 
  27.  
  28.    return c0; 
  29. }